@echo off
Title Don's Applet Signer
:sign
color 9
echo.
echo.
echo Please generate a key with the alias 1186se before running
echo See the Google Doc "1186 Project - How to Run, etc." for more details.
echo ~Don
echo.
echo.

rem @echo on

javac *.java
@echo off
if  errorlevel  1  goto  error
color a
REM echo Please Ensure Compilation Success
REM pause
REM @echo on
mkdir Jar
mkdir Jar\oracle
rem @echo on
xcopy .\oracle .\Jar\oracle /s/e/I/y
xcopy .\files .\Jar\files /s/e/I/y
@echo off
copy *.wav ".\Jar"
copy *.class ".\Jar" 
copy classes12.zip ".\Jar" 
cd jar
color a
jar -cvf applet.jar .
rem jar -cuvf applet.jar *.class
rem @echo on
color e
jarsigner applet.jar 1186se
if  errorlevel  1  goto  error2
cd ..
copy Jar\applet.jar applet.jar
rem del /S/Q Jar
rd /s/q Jar
color 9
echo.
echo.
echo Applet Successfully Signed
echo.
pause

goto end

:error
echo.
echo.
color c
echo Compilation Failed
echo Please Correct Errors and run again
echo.
pause
goto end

:error2
:error
echo.
echo.
color c
echo Signing Failed.  Invalid Password, or key not present
echo Please Correct Errors and run again
echo.
pause
goto end

:end
pause
cls
goto sign
